<?php
/**
 * Created by PhpStorm.
 * User: 毛文科
 * Date: 2019/5/25
 * Time: 11:10
 */
namespace app\admin\model;
use think\Db;

class InsTalls{
    static public function insert($modular){
        $shuju = [
            [
                'id'=>1,
                'model_name'=>'后台用户表',
                'model_table'=>$modular.'_admin_user',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>2,
                'model_name'=>'栏目表',
                'model_table'=>$modular.'_column',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>3,
                'model_name'=>'数据库备份表',
                'model_table'=>$modular.'_databases',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>4,
                'model_name'=>'数据库备份设置表',
                'model_table'=>$modular.'_database_system',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>5,
                'model_name'=>'文档表',
                'model_table'=>$modular.'_document',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>6,
                'model_name'=>'附件表',
                'model_table'=>$modular.'_enclosure',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>7,
                'model_name'=>'字段表',
                'model_table'=>$modular.'_fields',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>8,
                'model_name'=>'后台权限表',
                'model_table'=>$modular.'_jurs',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>9,
                'model_name'=>'关键词表',
                'model_table'=>$modular.'_keywords',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>10,
                'model_name'=>'模型表',
                'model_table'=>$modular.'_models',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>11,
                'model_name'=>'七牛云设置表',
                'model_table'=>$modular.'_qiniu',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>12,
                'model_name'=>'角色表',
                'model_table'=>$modular.'_roles',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>13,
                'model_name'=>'全局设置表',
                'model_table'=>$modular.'_systems',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>14,
                'model_name'=>'用户表',
                'model_table'=>$modular.'_users',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>null
            ],
            [
                'id'=>15,
                'model_name'=>'微信设置表',
                'model_table'=>$modular.'_wechats',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>16,
                'model_name'=>'模块设置表',
                'model_table'=>$modular.'_mokuais',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>1
            ],
            [
                'id'=>17,
                'model_name'=>'凌凯短信设置',
                'model_table'=>$modular.'_linkai',
                'model_type'=>'单表模型',
                'table_engine'=>'innodb',
                'status'=>'1',
                'create_time'=>time(),
                'delete_time'=>0
            ]
        ];
        foreach ($shuju as $value){
            Db::name($modular.'_models')->insert($value);
        }
        $field =[
            [
                'field_name'=>'用户名',
                'field'=>'user',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>1,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0,
            ],
            [
                'field_name'=>'昵称',
                'field'=>'nickname',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>1,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'角色id',
                'field'=>'role_id',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>1,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'手机',
                'field'=>'phone',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>1,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'邮箱',
                'field'=>'email',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>1,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'状态',
                'field'=>'status',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>1,
                'form_type'=>'开关',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'头像',
                'field'=>'portrait',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>1,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'密码',
                'field'=>'pwd',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>1,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'上级id',
                'field'=>'pid',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>1,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'栏目名称',
                'field'=>'name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>2,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'栏目英文名称',
                'field'=>'en_name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>2,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'图标',
                'field'=>'imgs',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>2,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'模型id',
                'field'=>'model_id',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>2,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'上级id',
                'field'=>'pid',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>2,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'创建时间',
                'field'=>'create_time',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>2,
                'form_type'=>'时间',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'状态',
                'field'=>'status',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>2,
                'form_type'=>'开关',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'链接地址',
                'field'=>'action',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>2,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'document/show_list',
                'delete'=>0
            ],
            [
                'field_name'=>'前端控制器url',
                'field'=>'url',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>2,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'index',
                'delete'=>0
            ],
            [
                'field_name'=>'前端列表页面',
                'field'=>'list',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>2,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'list',
                'delete'=>0
            ],
            [
                'field_name'=>'前端详情页面',
                'field'=>'detail',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>2,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'detail',
                'delete'=>0
            ],
            [
                'field_name'=>'前端控制器',
                'field'=>'index_action',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>2,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>'',
                'delete'=>0
            ],
            [
                'field_name'=>'软删除字段',
                'field'=>'delete_time',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>2,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'模块id',
                'field'=>'mokuai_id',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>$modular.'_mokuai',
                'status'=>1,
                'model_id'=>2,
                'form_type'=>'联动下拉框',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'创建时间',
                'field'=>'create_time',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>4,
                'form_type'=>'时间',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'文件路径',
                'field'=>'path',
                'type'=>'255',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>4,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'备注',
                'field'=>'remarks',
                'type'=>'255',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>4,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'文件名称',
                'field'=>'name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>4,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'数据库配置值',
                'field'=>'name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>3,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'文件名称',
                'field'=>'value',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>3,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'栏目id',
                'field'=>'cid',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>5,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'创建时间',
                'field'=>'create_time',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>5,
                'form_type'=>'时间',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'更新时间',
                'field'=>'update_time',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>5,
                'form_type'=>'时间',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'排序',
                'field'=>'sort',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>5,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'状态',
                'field'=>'status',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>5,
                'form_type'=>'开关',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'软删除',
                'field'=>'delete_time',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>5,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'是否可删除',
                'field'=>'delete',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>5,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'原名称',
                'field'=>'yuan_name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>6,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'现名称',
                'field'=>'new_name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>6,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'所在地址',
                'field'=>'path',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>6,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'缩略图地址',
                'field'=>'quan_path',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>6,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'状态',
                'field'=>'status',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>6,
                'form_type'=>'开关',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'创建时间',
                'field'=>'create_time',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>6,
                'form_type'=>'时间',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'字段中文名',
                'field'=>'field_name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>7,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'字段名',
                'field'=>'field',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>7,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'类型',
                'field'=>'type',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>7,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'长度',
                'field'=>'lang',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>7,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'下拉框，单选框，多选框选项',
                'field'=>'option',
                'type'=>'text',
                'lang'=>0,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>7,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'联表表名',
                'field'=>'table',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>7,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'状态,',
                'field'=>'status',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>7,
                'form_type'=>'开关',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'模型id',
                'field'=>'model_id',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>7,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'表单类型',
                'field'=>'form_type',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>7,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'排序',
                'field'=>'sort',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>7,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'层级',
                'field'=>'hierarchy',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>7,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'默认值',
                'field'=>'defaults',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>7,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'是否可删除',
                'field'=>'delete',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>7,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'权限名称',
                'field'=>'jur_name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>8,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'模型id',
                'field'=>'model_id',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>8,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'增删改查',
                'field'=>'descs',
                'type'=>'varchar',
                'lang'=>5,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>8,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'状态',
                'field'=>'status',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>8,
                'form_type'=>'开关',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'创建时间',
                'field'=>'create_time',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>8,
                'form_type'=>'时间',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'栏目id',
                'field'=>'cid',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>8,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'关键词',
                'field'=>'keyword',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>9,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'关键词描述',
                'field'=>'descriptions',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>9,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'栏目控制器',
                'field'=>'lanmu',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>9,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'状态',
                'field'=>'status',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>9,
                'form_type'=>'开关',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'创建时间',
                'field'=>'create_time',
                'type'=>'int',
                'lang'=>50,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>9,
                'form_type'=>'时间',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'更新时间',
                'field'=>'update_time',
                'type'=>'int',
                'lang'=>50,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>9,
                'form_type'=>'时间',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'模型名称',
                'field'=>'model_name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>10,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'表名称',
                'field'=>'model_table',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>10,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'表类型',
                'field'=>'model_type',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>10,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'引擎',
                'field'=>'table_engine',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>10,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'状态',
                'field'=>'status',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>10,
                'form_type'=>'开关',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'创建时间',
                'field'=>'create_time',
                'type'=>'int',
                'lang'=>50,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>10,
                'form_type'=>'时间',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'软删除字段',
                'field'=>'delete_time',
                'type'=>'int',
                'lang'=>50,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>10,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'七牛云连接域名',
                'field'=>'url',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>11,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'七牛云的ak',
                'field'=>'ak',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>11,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'七牛云的sk',
                'field'=>'sk',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>11,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'七牛云的bucket',
                'field'=>'bucket',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>11,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'是否启用',
                'field'=>'status',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>11,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'七牛名称',
                'field'=>'name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>11,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'角色名称',
                'field'=>'role_name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>12,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'上级角色的id',
                'field'=>'pid',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>12,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'权限的json数组',
                'field'=>'role',
                'type'=>'text',
                'lang'=>0,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>12,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'图标',
                'field'=>'iocn',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>12,
                'form_type'=>'单图片',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'状态',
                'field'=>'status',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>12,
                'form_type'=>'开关',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'配置名称',
                'field'=>'name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>13,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'配置值',
                'field'=>'value',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>13,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'配置类型（支持text img）',
                'field'=>'type',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>13,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'状态',
                'field'=>'status',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>13,
                'form_type'=>'开关',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'是否可删除',
                'field'=>'deletes',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>13,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'描述',
                'field'=>'descs',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>13,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'英文名称',
                'field'=>'en_name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>13,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'图片',
                'field'=>'tupian',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>13,
                'form_type'=>'单图片',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'用户名',
                'field'=>'user',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>14,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'状态',
                'field'=>'status',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>14,
                'form_type'=>'开关',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'描述',
                'field'=>'dir',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>14,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'排序',
                'field'=>'sort',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>14,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'创建时间',
                'field'=>'create_time',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>14,
                'form_type'=>'时间',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'更新时间',
                'field'=>'update_time',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>14,
                'form_type'=>'时间',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'是否可编辑',
                'field'=>'edit',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>14,
                'form_type'=>'开关',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'密码',
                'field'=>'pwd',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>14,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'头像',
                'field'=>'touxiang',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>14,
                'form_type'=>'单图片',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'软删除字段',
                'field'=>'delete_time',
                'type'=>'int',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>14,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'名称',
                'field'=>'name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>15,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'公众号appid',
                'field'=>'appid',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>15,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'公众号appsecret',
                'field'=>'appsecret',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>15,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'公众号mch_id',
                'field'=>'mch_id',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>15,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'公众号mch_key',
                'field'=>'mch_key',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>15,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'公众号notify_url一步回调',
                'field'=>'notify_url',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>15,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'微信支付币种',
                'field'=>'fee_type',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>15,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'调用微信支付API的机器IP',
                'field'=>'spbill_create_ip',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>15,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'模块名称',
                'field'=>'name',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>16,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'模块状态',
                'field'=>'status',
                'type'=>'int',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>16,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'账号',
                'field'=>'corpid',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>17,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'密码',
                'field'=>'pwd',
                'type'=>'varchar',
                'lang'=>255,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>17,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'是否可删除',
                'field'=>'delete',
                'type'=>'varchar',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>17,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ],
            [
                'field_name'=>'状态',
                'field'=>'status',
                'type'=>'varchar',
                'lang'=>1,
                'option'=>'',
                'table'=>'',
                'status'=>1,
                'model_id'=>17,
                'form_type'=>'单行文本',
                'sort'=>100,
                'hierarchy'=>1,
                'defaults'=>null,
                'delete'=>0
            ]

        ] ;
        foreach ($field as $value){
            Db::name($modular.'_fields')->insert($value);
        }
        $databasessystem = [
            [
                'id'=>1,
                'name'=>'自动备份',
                'value'=>0
            ],
            [
                'id'=>2,
                'name'=>'自动备份间隔(天)',
                'value'=>0
            ],
            [
                'id'=>3,
                'name'=>'上次备份时间',
                'value'=>0
            ],
        ];
        foreach ($databasessystem as $value){
            Db::name($modular.'_database_system')->insert($value);
        }
        return true;
    }
}
